package com.tool.cn.algorithm.proxy.handler;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * 
 * @author wangzonghui
 * @date 2021年12月30日 上午10:16:36 
 * @Description 动态代理类
 */
public class ProxyHandler implements InvocationHandler{

	private Object object;
    public ProxyHandler(Object object){
        this.object = object;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("Before invoke "  + method.getName());
        method.invoke(object, args);
        System.out.println("After invoke " + method.getName());
        return null;
    }
}
